<?php require VIEW_ROOT.'/common/header.php'?>

<style>
.top { color:#ff0000; }
</style>

<div class="info">
	显示数目：
	<a href="./?m=link&a=top&limit=10">10</a>
	/
	<a href="./?m=link&a=top&limit=20">20</a>
	/
	<a href="./?m=link&a=top&limit=50">50</a>
	/
	<a href="./?m=link&a=top&limit=100">100</a>
</div>

<table style="width:200px; float:left;">
	<tr>
		<th colspan="3">总点击量</th>
	</tr>
	<?php $i = 0?>
	<?php foreach ($res_all as $row) {?>
		<tr>
			<td width="20"><b><?php echo ++$i <= 3 ? "<span class='top'>$i</span>" : $i?></b></td>
			<td>
				<?php echo $row['title']?>
				<?php echo $row['parent_id'] ? '('.$item_data[$row['parent_id']]['title'].')' : ''?>
			</td>
			<td width="40"><?php echo $row['hits']?></td>
		</tr>
	<?php }?>
</table>

<table style="width:200px; float:left; margin-left:10px;">
	<tr>
		<th colspan="3">上班时间点击排行</th>
	</tr>
	<?php $i = 0?>
	<?php foreach ($res_work1 as $row) {?>
		<tr>
			<td width="20"><b><?php echo ++$i <= 3 ? "<span class='top'>$i</span>" : $i?></b></td>
			<td>
				<?php echo $item_data[$row['link_item_id']]['title']?>
				<?php echo $item_data[$row['link_item_id']]['parent_id'] ? '('.$item_data[$item_data[$row['link_item_id']]['parent_id']]['title'].')' : ''?>	
			</td>
			<td width="40"><?php echo $row['hits']?></td>
		</tr>
	<?php }?>
</table>

<table style="width:200px; float:left; margin-left:10px;">
	<tr>
		<th colspan="3">下班时间点击排行</th>
	</tr>
	<?php $i = 0?>
	<?php foreach ($res_work2 as $row) {?>
		<tr>
			<td width="20"><b><?php echo ++$i <= 3 ? "<span class='top'>$i</span>" : $i?></b></td>
			<td>
				<?php echo $item_data[$row['link_item_id']]['title']?>
				<?php echo $item_data[$row['link_item_id']]['parent_id'] ? '('.$item_data[$item_data[$row['link_item_id']]['parent_id']]['title'].')' : ''?>	
			</td>
			<td width="40"><?php echo $row['hits']?></td>
		</tr>
	<?php }?>
</table>

<table style="width:200px; float:left; margin-left:10px;">
	<tr>
		<th colspan="3">30天点击量</th>
	</tr>
	<?php $i = 0?>
	<?php foreach ($res_recent_30days as $row) {?>
		<tr>
			<td width="20"><b><?php echo ++$i <= 3 ? "<span class='top'>$i</span>" : $i?></b></td>
			<td>
				<?php echo $item_data[$row['link_item_id']]['title']?>
				<?php echo $item_data[$row['link_item_id']]['parent_id'] ? '('.$item_data[$item_data[$row['link_item_id']]['parent_id']]['title'].')' : ''?>	
			</td>
			<td width="40"><?php echo $row['hits']?></td>
		</tr>
	<?php }?>
</table>

<table style="width:200px; float:left; margin-left:10px;">
	<tr>
		<th colspan="3">72小时点击量</th>
	</tr>
	<?php $i = 0?>
	<?php foreach ($res_recent as $row) {?>
		<tr>
			<td width="20"><b><?php echo ++$i <= 3 ? "<span class='top'>$i</span>" : $i?></b></td>
			<td>
				<?php echo $item_data[$row['link_item_id']]['title']?>
				<?php echo $item_data[$row['link_item_id']]['parent_id'] ? '('.$item_data[$item_data[$row['link_item_id']]['parent_id']]['title'].')' : ''?>	
			</td>
			<td width="40"><?php echo $row['hits']?></td>
		</tr>
	<?php }?>
</table>

<table style="width:200px; float:left; margin-left:10px;">
	<tr>
		<th colspan="3">已删除链接点击量</th>
	</tr>
	<?php $i = 0?>
	<?php foreach ($res_all_deleted as $row) {?>
		<tr>
			<td width="20"><b><?php echo ++$i <= 3 ? "<span class='top'>$i</span>" : $i?></b></td>
			<td>
				<?php echo $row['title']?>
				<?php echo $row['parent_id'] ? '('.$item_data[$row['parent_id']]['title'].')' : ''?>
			</td>
			<td width="40"><?php echo $row['hits']?></td>
		</tr>
	<?php }?>
</table>

<table style="width:200px; float:left; margin-left:10px;">
	<tr>
		<th colspan="3">分类点击排行</th>
	</tr>
	<?php $i = 0?>
	<?php foreach ($res_category_top as $row) {?>
		<tr>
			<td width="20"><b><?php echo ++$i <= 3 ? "<span class='top'>$i</span>" : $i?></b></td>
			<td>
				<?php echo $category_data[$row['link_cat_id']]['name']?>
			</td>
			<td width="40"><?php echo $row['hits']?></td>
		</tr>
	<?php }?>
</table>

<table style="width:200px; float:left; margin-left:10px;">
	<tr>
		<th colspan="3">时段点击排行</th>
	</tr>
	<?php $i = 0?>
	<?php foreach ($res_hour_top as $row) {?>
		<tr>
			<td width="20"><b><?php echo ++$i <= 3 ? "<span class='top'>$i</span>" : $i?></b></td>
			<td>
				<?php echo $row['hour']?> 时
				<?php echo ($row['hour']>=9 && $row['hour']<18) ? '(工作)' : ''?>
			</td>
			<td width="40"><?php echo $row['hits']?></td>
		</tr>
	<?php }?>
</table>

<table style="width:200px; float:left; margin-left:10px;">
	<tr>
		<th colspan="3">时段点击排行(今日)</th>
	</tr>
	<?php $i = 0?>
	<?php foreach ($res_hour_top2 as $row) {?>
		<tr>
			<td width="20"><b><?php echo ++$i <= 3 ? "<span class='top'>$i</span>" : $i?></b></td>
			<td>
				<?php echo $row['hour']?> 时
				<?php echo ($row['hour']>=9 && $row['hour']<18) ? '(工作)' : ''?>
			</td>
			<td width="40"><?php echo $row['hits']?></td>
		</tr>
	<?php }?>
</table>

<table style="width:200px; float:left; margin-left:10px;">
	<tr>
		<th colspan="3">时段点击排行(历史分时)</th>
	</tr>
	<?php $i = 0?>
	<?php foreach ($res_hour_all_top as $row) {?>
		<tr>
			<td width="20"><b><?php echo ++$i <= 3 ? "<span class='top'>$i</span>" : $i?></b></td>
			<td>
				<?php echo date('Y.m.d - H', $row['create_time']); ?>
			</td>
			<td width="40"><?php echo $row['hits']?></td>
		</tr>
	<?php }?>
</table>

<table style="width:200px; float:left; margin-left:10px;">
	<tr>
		<th colspan="3">日点击排行</th>
	</tr>
	<?php $i = 0?>
	<?php foreach ($res_day_top as $row) {?>
		<tr>
			<td width="20"><b><?php echo ++$i <= 3 ? "<span class='top'>$i</span>" : $i?></b></td>
			<td>
				<?php echo date('Y.m.d D', $row['create_time'])?>
			</td>
			<td width="40"><?php echo $row['hits']?></td>
		</tr>
	<?php }?>
</table>

<table style="width:200px; float:left; margin-left:10px;">
	<tr>
		<th colspan="3">每日点击</th>
	</tr>
	<?php $i = 0?>
	<?php foreach ($res_day_hits as $row) {?>
		<tr>
			<td width="20"><b><?php echo ++$i <= 3 ? "<span class='top'>$i</span>" : $i?></b></td>
			<td>
				<?php echo date('Y.m.d D', $row['create_time'])?>
			</td>
			<td width="40"><?php echo $row['hits']?></td>
		</tr>
	<?php }?>
</table>

<table style="width:200px; float:left; margin-left:10px;">
	<tr>
		<th colspan="3">最近点击</th>
	</tr>
	<?php $i = 0?>
	<?php foreach ($res_hitting as $row) {?>
		<tr>
			<td width="20"><b><?php echo ++$i <= 3 ? "<span class='top'>$i</span>" : $i?></b></td>
			<td>
				<?php echo $item_data[$row['link_item_id']]['title']?>
				<?php echo $item_data[$row['link_item_id']]['parent_id'] ? '('.$item_data[$item_data[$row['link_item_id']]['parent_id']]['title'].')' : ''?>	
			</td>
			<td width="40"><?php echo date('H:i', $row['create_time'])?></td>
		</tr>
	<?php }?>
</table>

<div style="height:0; clear:both;"></div>

<?php require VIEW_ROOT.'/common/footer.php'?>
